package com.kaoshi.agency.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kaoshi.agency.domain.Qianyue;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 杨家林
* @description 针对表【qianyue】的数据库操作Mapper
* @createDate 2024-10-29 09:23:40
* @Entity com.kaoshi.agency.domain.Qianyue
*/
public interface QianyueMapper extends BaseMapper<Qianyue> {

    List<Qianyue> findAll(Page<Qianyue> page, Qianyue qianyue);

    List<Qianyue> findAllJl(Page<Qianyue> page, Qianyue qianyue);

    @Select("select q.*,t.name tname,f.name fname,c.name cname,c.sex csex,c.age cage,c.gx,t.name tname,j.name jname,y.name yname from qianyue q\n" +
            "        left join tuandui t on q.tid=t.id\n" +
            "        left join fwb f on q.fid=f.id\n" +
            "        left join jiating c on q.cid=c.id\n" +
            "        left join jigo j on q.jid=j.id\n" +
            "        left join yisheng y on q.yid=y.id where q.id=#{id}")
    Qianyue findById(Integer id);


    @Select("select q.*,t.name tname,f.name fname,c.name cname,c.sex csex,c.age cage,c.gx,t.name tname,j.name jname,y.name yname from qianyue q\n" +
            "        left join tuandui t on q.tid=t.id\n" +
            "        left join fwb f on q.fid=f.id\n" +
            "        left join jiating c on q.cid=c.id\n" +
            "        left join jigo j on q.jid=j.id\n" +
            "        left join yisheng y on q.yid=y.id")
    List<Qianyue> findAll2();

}




